package service.impl;

import java.util.List;

import service.IGoodsService;
import vo.GoodsInfo;
import dao.IGoodsDAO;
import dao.impl.GoodsDAO;

public class GoodsServices implements IGoodsService {
	private IGoodsDAO GoodsDAO;

	@Override
	public List getGoods(int page, int rows) {

		return GoodsDAO.getGoods(page, rows);
	}

	public IGoodsDAO getStorageDAO() {

		return GoodsDAO;
	}

	public void setGoodsDAO(IGoodsDAO GoodsDAO) {

		this.GoodsDAO = GoodsDAO;
	}

	@Override
	public void addGoods(GoodsInfo goodsinfo) {
		// TODO Auto-generated method stub
		this.GoodsDAO.addGoods(goodsinfo);
	}

	@Override
	public void deleteGoods(GoodsInfo goodsinfo) {
		// TODO Auto-generated method stub
		this.GoodsDAO.deleteGoods(goodsinfo);
	}

	@Override
	public void updateGoods(GoodsInfo goodsinfo) {
		// TODO Auto-generated method stub
		this.GoodsDAO.updateGoods(goodsinfo);
	}

	@Override
	public GoodsInfo findGoodsById(int GId) {
		// TODO Auto-generated method stub

		return this.GoodsDAO.findGoodsById(GId);
	}

	@Override
	public List searchGoods(String hql) {

		// TODO Auto-generated method stub
		return this.GoodsDAO.searchGoods(hql);

	}

	@Override
	public int getTotalNum() {
		// TODO Auto-generated method stub
		return this.GoodsDAO.getTotalNum();
	}

}
